#
# Copyright (c) 2019 Tang, Haifeng <tang-haifeng@foxmail.com>
#
# SPDX-License-Identifier:	GPL-2.0+
#

include $(TOPDIR)/config.mk

LIB	= $(obj)lib$(BOARD).o

COBJS-y	+= $(BOARD).o
SOBJS	= lowlevel_init.o

COBJS-$(CONFIG_LOONGSON_BOOTELF) += bootelf_loongson.o bootparam.o
COBJS-$(CONFIG_VIDEO_LS1X)	+= ls2x_video.o
COBJS-$(CONFIG_SII9022A)	+= sii9022a.o

#COBJS-y += save_ddrparam.o
COBJS-y += tlb.o

COBJS	:= $(COBJS-y)
SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS	:= $(addprefix $(obj),$(COBJS))
SOBJS	:= $(addprefix $(obj),$(SOBJS))

$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
	$(call cmd_link_o_target, $(OBJS) $(SOBJS))

#########################################################################

# defines $(obj).depend target
include $(SRCTREE)/rules.mk

sinclude $(obj).depend

#########################################################################
